USE [NamaAlart]
GO

/****** Object:  StoredProcedure [dbo].[GetTag]    Script Date: 04/26/2009 22:01:20 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE PROCEDURE [dbo].[GetTag]
@sid nvarchar(100),
@cstr nvarchar(100) 
AS
SET NOCOUNT ON;

DECLARE @lid bigint;
SET @lid=(SELECT ID FROM LiveInfo WHERE StationID=@sid AND Caster=@cstr);

IF @lid IS NULL
	RETURN 1;
ELSE
	SELECT TagValue FROM TagInfo WHERE LiveInfoID=@lid;

SET NOCOUNT OFF;


GO


